﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BSCMFF.Core.DataAccessLayer;

namespace BSCMFF.Core.BusinessLayer
{
    /// <summary>
    /// Manages KPI
    /// </summary>
    /// <remarks></remarks>
    public class KPIManager
    {
        /// <summary>
        /// Sets the perspective ID for KPI.
        /// </summary>
        /// <param name="kpi">The kpi.</param>
        /// <param name="perspective">The perspective.</param>
        /// <returns></returns>
        /// <remarks></remarks>
        public KPI SetKPIPerspective_FK(KPI kpi, string perspective)
        {
            BSCEntities context = new BSCEntities();

            Perspective persp = (from p in context.Perspectives
                                 where p.Name == perspective
                                 select p).Single();

            kpi.Perspective_FK = persp.Perspective_ID;

            return kpi;
        }

        /// <summary>
        /// Creates the KPI with start progress.
        /// </summary>
        /// <param name="kpi">The kpi.</param>
        /// <returns></returns>
        /// <remarks></remarks>
        public KPI CreateKPIWithStartProgress(KPI kpi)
        {
            return null;
        }
    }
}
